package bounce;

/** 
 * Class to represent an oval with text.
 * 
 * @author Ken Neth Yeoh
 *
 */

public class OvalTextShape extends Shape {

	private String message;
	
	public OvalTextShape(int x, int y, int deltaX, int deltaY, int width, int height, String message) {
		super(x, y, deltaX, deltaY, width, height);
		this.message = message;
	}

	@Override
	public void paint(Painter painter) {
		int vertX;
		int vertY;
		painter.drawOval(fX, fY, fWidth, fHeight);
		vertX = fX + (fWidth / 2);
		vertY = fY + (fHeight / 2);
		painter.drawCentredText(message, vertX, vertY);
	}
}
